//引入koa-router依赖
const Router = require("koa-router");

// 从对象userController中解构出create
//编写的业务逻辑
const { create,avatarInfo } = require("../controller/user.controller");
const { verifyUser,handlePassword } = require("../middleware/user.middleware");
//初始化userRouter路由
const userRouter = new Router({ prefix: "/users" });

//注册接口,将逻辑部分抽离
userRouter.post("/", verifyUser, handlePassword, create);
userRouter.get('/:userId/avatar', avatarInfo);

module.exports = userRouter;
